//
//  WXLReusableCollectionViewCell.m
//  段子手
//
//  Created by dllo on 16/3/20.
//  Copyright © 2016年 JokesTeam. All rights reserved.
//

#import "WXLReusableCollectionViewCell.h"

@interface WXLReusableCollectionViewCell ()

@property (nonatomic, retain) UIImageView *imgView;
@property (nonatomic, retain) UILabel *titleLable;

@end

@implementation WXLReusableCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView {
    self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake((self.bounds.size.width - 30) / 2, 0, 30, 30)];
    [self addSubview:_imgView];
    
    self.titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, _imgView.frame.size.height + 5, self.bounds.size.width, 25)];
    [self addSubview:_titleLable];
    _titleLable.textAlignment = NSTextAlignmentCenter;
    _titleLable.textColor = [UIColor blackColor];
}

- (void)setModel:(WXLActionModel *)model {
    _model = model;
    
    [_imgView HANDLEIMAGE(_model.picUrl)];
    _titleLable.text = _model.name;
}

@end
